package com.knife.blog.domain;

import com.knife.dbo.IObject;
import com.knife.util.CommUtil;

import java.io.Serializable;

public class BlogInfo implements IObject, Serializable {

	// 属性部份

	private static final long serialVersionUID = 1L;
	private String cid;
	private String username;
	private String nickname;
	private String title;
	private String subtitle;
	private String intro;
	private String email;
	private String replyemail;
	private String dirsn;
	private String tagimg;
	private String metadescription;
	private String metakeyword;
	private String template;
	private Integer firtpagenum;
	private Integer listnum;
	private Integer managelistnum;
	private Integer newmessagenum;
	private Integer topreadnum;
	private Integer topreviewnum;
	private Integer enablereview;
	private Integer enableemail;
	private Integer showcontent;
	private Integer totalnumdisplay;
	private Integer editortype;
	private Integer controldisplay;
	private String inputuser;
	private java.util.Date inputtime;
	private Integer readtimes;
	private Integer status;
	private String type;
	private int elite;

	private String domain;
	private String configsn;
	private Boolean updated;
	private int isnew;
	private int ishot;

	//自动映射部份
	public String getTableName() {
		return "bloginfo";
	}

	public String getKeyField() {
		return "cid";
	}

	public String getKeyGenerator() {
		return "com.knife.dbo.RandomIdGenerator";
	}

	public String getUrl() {
		return "/blog.do?parameter=index&user="
				+ com.knife.util.HtmlUtil.encodeUrl(this.username);
	}

	public String getBlogName() {
		String ret = this.nickname;
		if (ret == null || "".equals(ret))
			ret = this.title;
		if (ret == null || "".equals(ret))
			ret = this.username;
		return ret;
	}

	// getter及setter方法

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickName) {
		this.nickname = nickName;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubtitle() {
		return subtitle;
	}

	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getReplyemail() {
		return replyemail;
	}

	public void setReplyemail(String replyEmail) {
		this.replyemail = replyEmail;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTagimg() {
		return tagimg;
	}

	public void setTagimg(String tagImg) {
		this.tagimg = tagImg;
	}

	public String getMetadescription() {
		return metadescription;
	}

	public void setMetadescription(String metaDescription) {
		this.metadescription = metaDescription;
	}

	public String getMetakeyword() {
		return metakeyword;
	}

	public void setMetakeyword(String metaKeyword) {
		this.metakeyword = metaKeyword;
	}

	public String getTemplate() {
		if (!com.knife.util.CommUtil.hasLength(this.template))
			return "default";
		return template;
	}

	public void setTemplate(String template) {
		this.template = template;
	}

	public Integer getFirtpagenum() {
		return firtpagenum;
	}

	public void setFirtpagenum(Integer firtpageNum) {
		this.firtpagenum = firtpageNum;
	}

	public Integer getListnum() {
		return listnum;
	}

	public void setListnum(Integer listNum) {
		this.listnum = listNum;
	}

	public Integer getManagelistnum() {
		return managelistnum;
	}

	public void setManagelistnum(Integer manageListNum) {
		this.managelistnum = manageListNum;
	}

	public Integer getNewmessagenum() {
		return newmessagenum;
	}

	public void setNewmessagenum(Integer newMessageNum) {
		this.newmessagenum = newMessageNum;
	}

	public Integer getTopreadnum() {
		return topreadnum;
	}

	public void setTopreadnum(Integer topReadNum) {
		this.topreadnum = topReadNum;
	}

	public Integer getTopreviewnum() {
		return topreviewnum;
	}

	public void setTopreviewnum(Integer topReviewNum) {
		this.topreviewnum = topReviewNum;
	}

	public Integer getEnablereview() {
		return enablereview;
	}

	public void setEnablereview(Integer enableReview) {
		this.enablereview = enableReview;
	}

	public Integer getEnableemail() {
		return enableemail;
	}

	public void setEnableemail(Integer enableEmail) {
		this.enableemail = enableEmail;
	}

	public Integer getShowcontent() {
		return showcontent;
	}

	public void setShowcontent(Integer showContent) {
		this.showcontent = showContent;
	}

	public Integer getTotalnumdisplay() {
		return totalnumdisplay;
	}

	public void setTotalnumdisplay(Integer totalNumDisplay) {
		this.totalnumdisplay = totalNumDisplay;
	}

	public Integer getEditortype() {
		return editortype;
	}

	public void setEditortype(Integer editorType) {
		this.editortype = editorType;
	}

	public Integer getControldisplay() {
		return controldisplay;
	}

	public void setControldisplay(Integer controlDisplay) {
		this.controldisplay = controlDisplay;
	}

	public java.util.Date getInputtime() {
		return inputtime;
	}

	public void setInputtime(java.util.Date inputtime) {
		this.inputtime = inputtime;
	}

	public Integer getReadtimes() {
		return readtimes;
	}

	public void setReadtimes(Integer readTimes) {
		this.readtimes = readTimes;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public int getElite() {
		return elite;
	}

	public void setElite(int elite) {
		this.elite = elite;

	}

	public String getDomain() {
		if (!CommUtil.hasLength(this.domain))
			return this.getUsername();
		return domain;
	}

	public void setDomain(String domain) {
		this.domain = domain;
	}

	public Boolean getUpdated() {
		return updated;
	}

	public void setUpdated(Boolean haveUpdate) {
		this.updated = haveUpdate;
	}

	public String getDirsn() {
		return dirsn;
	}

	public void setDirsn(String dirsn) {
		this.dirsn = dirsn;
	}

	public String getInputuser() {
		return inputuser;
	}

	public void setInputuser(String inputuser) {
		this.inputuser = inputuser;
	}

	public boolean isUserBlog() {
		return type.equals("userBlog") ? true : false;
	}

	public boolean isCircleBlog() {
		return type.equals("circleBlog") ? true : false;
	}

	public String getConfigsn() {
		return configsn;
	}

	public void setConfigsn(String configSn) {
		this.configsn = configSn;
	}

	public int getIsnew() {
		return isnew;
	}

	public void setIsnew(int isNew) {
		this.isnew = isNew;
	}

	public int getIshot() {
		return ishot;
	}

	public void setIshot(int isHot) {
		this.ishot = isHot;
	}
}
